﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CarolLib.Configuration;
using System.Xml;

namespace DCS.Configuration
{
    public class ServiceConfiguration : ConfigurationBase
    {
        public List<ServiceEntity> services { get; private set; }

        public static ServiceConfiguration GetConfig()
        {
            return GetConfig<ServiceConfiguration>("services");
        }

        protected override void LoadValuesFromConfigurationXml(System.Xml.XmlNode node)
        {
            XmlNodeList ns = node.SelectNodes("service");
            services = new List<ServiceEntity>();

            foreach (XmlNode n in ns)
            {
                ServiceEntity se = new ServiceEntity(n);
                services.Add(se);
            }
        }
    }
}
